﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace RedMoon.SoftUpdate
{
    public partial class SoftUpdate : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                string user = Session["LoginSuccess"].ToString();
            }
            catch (Exception ex)
            {
                Response.Write("不要非法登录！记录IP：" + Request.UserHostAddress);
                Response.End();
            }
        }
        private void responseHtml()
        {
            Response.Write(Session.Timeout);
            string path = Server.MapPath(".");
            System.Text.StringBuilder sb = new System.Text.StringBuilder();
            sb.Append(string.Format("当前时间: {0}", Server.HtmlEncode(DateTime.Now.ToString())));
            sb.Append("<br />");
            sb.Append(string.Format("当前请求的虚拟路径: {0}", Server.HtmlEncode(Request.CurrentExecutionFilePath)));
            sb.Append("<br />");
            sb.Append(string.Format("获取当前应用程序的根目录路径: {0}", Server.HtmlEncode(Request.ApplicationPath)));
            sb.Append("<br />");
            sb.Append(string.Format("当前请求的虚拟路径: {0}", Server.HtmlEncode(Request.FilePath)));
            sb.Append("<br />");
            sb.Append(string.Format("当前请求的虚拟路径: {0}", Server.HtmlEncode(Request.Path)));
            sb.Append("<br />");
            sb.Append(string.Format("获取当前正在执行的应用程序的根目录的物理文件系统路径: {0}", Server.HtmlEncode(Request.PhysicalApplicationPath)));
            sb.Append("<br />");
            sb.Append(string.Format("获取与请求的 URL 相对应的物理文件系统路径: {0}", Server.HtmlEncode(Request.PhysicalApplicationPath)));
            sb.Append("<br />");
            Response.Write(sb.ToString());
        }
    }
}